/*
* Valentine Gladstein
* SOLAR ID 108731583
* Homework #2
* CSE214
* Recitation 03-Phil Ammirato
* Grading TA: Yanjie LI
*/

import java.io.*;
import java.util.*;

public class CardInfoNode {
    //this class stores a CarDInfo object, as well as information about its next and previous nodes in the lsit.


    private CardInfo data;

    private CardInfoNode next;
    private CardInfoNode prev;


/**       
 * the default constructor. Creates an empty CardInfoNode.
 */ 
    public CardInfoNode() {
	data = null;
    }

/**       
 * Overriden constructor. Creates a CardInfoNode containing the data given as a parameter.
 * @param input: the CardInfo object to be stored as data in this CarDInfoNode
 */ 
    public CardInfoNode(CardInfo input) {
	data = input;
    }


/**       
 * Sets the data stored in this CardInfoNode to the CardInfo passed as a parameter.
 * @param info: the CardInfo object to be stored as data in this CarDInfoNode
 */
    public void setCardInfo(CardInfo info) {
	data = info;
    }

/**       
 * Gets the data stored in this CardInfoNode
 * @return : the CardInfo object stored as data in this CarDInfoNode
 */
    public CardInfo getInfo() {
	return data;
    }

/**       
 * Sets the next parameter to the CardInfoNode passed as a parameter.
 * @param node: the CardInfoNode object to be stored as the next node in the list.
 */
    public void setNext(CardInfoNode node) {
	next = node;
    }

/**       
 * Sets the prev parameter to the CardInfoNode passed as a parameter.
 * @param node: the CardInfoNode object to be stored as the previous node in the list.
 */
    public void setPrev(CardInfoNode node) {
	prev = node;
    }

/**       
 * Gets the next CardInfoNode object in the list.
 * @return : the CardInfoNode which follows the current CardInfoNode in the lsit.
 */
    public CardInfoNode getNext() {
	return next;
    }

/**       
 * Gets the previous CardInfoNode object in the list.
 * @return : the CardInfoNode which precedes the current CardInfoNode in the lsit.
 */
    public CardInfoNode getPrev() {
	return prev;
    }

/**       
 * Gets a string representation of the CardInfo stored in this node.
 * @return : a formatted String representation of the CardInfo object stored in this node.
 */
    public String dataToString() {
	return data.toString();
    }

}
